package com.detrum.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by chenlei on 2017/5/25.
 */

public class FileBean implements Parcelable {

    private String nfsPath;              // NFS路径
    private String fileName;             // 文件名
    private String cachePath;            // 缓存路径
    private long size;                    // 文件的大小
    private String fileType;             //文件格式, 是否为文件夹
    private long fileTime;               //文件时间
    private String time;                 //视频文件时长
    private boolean isSelect;            //是否被选择
    private String thumbPath;           //图片文件数据流--缩略图
    private int position;                //当前在集合的位置--刷新指定item时使用
    private int isLocal;                 //是否已下载
    private int isNfs;                   //是否在云上

    public FileBean() {
        isNfs = 10;
        isLocal = 10;
    }

    public FileBean(String nfsPath, String fileName, String time, String cachePath, String thumbPath,long size, long fileTime, int position, int isLocal, int isNfs) {
        this.nfsPath = nfsPath;
        this.fileName = fileName;
        this.time = time;
        this.cachePath = cachePath;
        this.size = size;
        this.fileTime = fileTime;
        this.position = position;
        this.isLocal = isLocal;
        this.isNfs = isNfs;
        this.thumbPath = thumbPath;
    }

    protected FileBean(Parcel in) {
        nfsPath = in.readString();
        fileName = in.readString();
        size = in.readInt();
        fileType = in.readString();
        fileTime = in.readLong();
        time = in.readString();
        position = in.readInt();
        cachePath = in.readString();
        thumbPath = in.readString();
        isLocal = in.readInt();
        isNfs = in.readInt();
    }

    public int getIsLocal() {
        return isLocal;
    }

    public void setIsLocal(int isLocal) {
        this.isLocal = isLocal;
    }

    public int getIsNfs() {
        return isNfs;
    }

    public void setIsNfs(int isNfs) {
        this.isNfs = isNfs;
    }

    public String getCachePath() {
        return cachePath;
    }

    public void setCachePath(String cachePath) {
        this.cachePath = cachePath;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public String getThumbPath() {
        return thumbPath;
    }

    public void setThumbPath(String thumbPath) {
        this.thumbPath = thumbPath;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public static final Creator<FileBean> CREATOR = new Creator<FileBean>() {
        @Override
        public FileBean createFromParcel(Parcel in) {
            return new FileBean(in);
        }

        @Override
        public FileBean[] newArray(int size) {
            return new FileBean[size];
        }
    };

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileName() {
        return fileName;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public long getSize() {
        return size;
    }

    public void setNfsPath(String nfsPath) {
        this.nfsPath = nfsPath;
    }

    public String getNfsPath() {
        return nfsPath;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileTime(long fileTime) {
        this.fileTime = fileTime;
    }

    public long getFileTime() {
        return fileTime;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(nfsPath);
        dest.writeString(fileName);
        dest.writeLong(size);
        dest.writeString(fileType);
        dest.writeLong(fileTime);
        dest.writeInt(position);
        dest.writeString(cachePath);
        dest.writeString(thumbPath);
        dest.writeInt(isLocal);
        dest.writeInt(isNfs);
        dest.writeString(time);
    }

    @Override
    public String toString() {
        return "nfsPath is "+nfsPath+"\nfileName is "+fileName+"\ncachePath is "+cachePath+"\nthumbPath is "+thumbPath+"\nsize is "+size+"\nfileType is "+fileType+"\nfileTime is "+fileTime+"\nposition is "+position+"\nisLocal is "+isLocal+"\nisNfs is "+isNfs;
    }
}
